import { ref, computed } from 'vue'

const zIndex = ref(0)
const useZIndex = (initialValue = 2000) => {
    const initialZindex = ref(initialValue)
    const currentZindex = computed(() => zIndex.value + initialZindex.value)
    const nextZindex = () => {
        zIndex.value++;
        return currentZindex.value
    }
    return {
        currentZindex,
        nextZindex,
        initialValue
    }
}

export default useZIndex